<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>表格</title>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
</head>
<body>
<script src="/layui/layui.js"></script>
<script>
    layui.use('table', function() {
        var table = layui.table;
        table.render({
            cols: [[ //标题栏
                {field: 'username', title: '联系人', width: 80, rowspan: 2} //rowspan即纵向跨越的单元格数
                , {field: 'amount', title: '金额', width: 80, rowspan: 2}
                , {align: 'center', title: '地址', colspan: 3} //colspan即横跨的单元格数，这种情况下不用设置field和width
            ], [
                {field: 'province', title: '省', width: 80}
                , {field: 'city', title: '市', width: 120}
                , {field: 'county', title: '详细', width: 300}
            ]]
        });
    });
</script>
<table class="layui-table" lay-data="{基础参数}">
    <thead>
    <tr>
        <th lay-data="{field:'username', width:80}" rowspan="2">联系人</th>
        <th lay-data="{field:'amount', width:120}" rowspan="2">金额</th>
        <th lay-data="{align:'center'}" colspan="3">地址</th>
    </tr>
    <tr>
        <th lay-data="{field:'province', width:80}">省</th>
        <th lay-data="{field:'city', width:120}">市</th>
        <th lay-data="{field:'county', width:300}">详细</th>
    </tr>
    </thead>
</table>
</body>
</html>